import java.sql.SQLException;


public class FactoryTest {

	/**
	 * @param args
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public static void main(String[] args) throws SQLException, ClassNotFoundException {
		
//		DBDAO oracleDAO = DBDAOFactory.create("Oracle", "scott", "tiger", "jdbc:oracle:thin:@192.168.0.10:1521/nams1", "oracle.jdbc.driver.OracleDriver");
//		java.sql.Connection conn = oracleDAO.connect();
//		
//		java.sql.PreparedStatement pstmt = null;
//		
////		String schemaInfo = conn.getSchema();
////		String schemaInfo = oracleDAO.getSchema();
////		System.out.println( "schemaInfo = " + schemaInfo);
////		java.sql.DatabaseMetaData dm =conn.getMetaData();
////		String schemaInfo = conn.getSchema();
////		String schemaInfo = oracleDAO.getSchemas();
////		System.out.println(dm.getDatabaseProductName());
//		DatabaseMetaData dbmd = conn.getMetaData();
//		java.sql.ResultSet rs = null;
//		String catalog = null;
//		
//		rs = dbmd.getSchemas();
//		System.out.println( "getSchemas()");
//		while( rs.next()) {
//			System.out.println( rs.getString(1));
//		}
//		
//		rs = dbmd.getCatalogs();
//		System.out.println( "getCatalogs()");
//		while( rs.next()) {
//			catalog = rs.getString(1);
//			System.out.println( rs.getString(1));
//		}
//		
//		rs = dbmd.getTableTypes();
//		System.out.println( "getTableTypes()");
//		while( rs.next()) {
//			catalog = rs.getString(1);
//			System.out.println( rs.getString(1));
//		}
//		
//		
//		String[] tableType = { "TABLE"};
//		rs = dbmd.getTables( null, "SCOTT", null, tableType);
////		rs = dbmd.getTables( null, null, null, null);
//		System.out.println( "getTables()");
//		while( rs.next()) {
//			System.out.print( rs.getString(1)); 			// Catalog
//			System.out.print( " | " + rs.getString(2));		// Schema
//			System.out.print( " | " + rs.getString(3));		// Table Name
//			System.out.println( " | " + rs.getString(4));	// Table Type
//		}
//		
//		System.out.println( "getUserName()");
//		System.out.println( dbmd.getUserName());
//		
//		oracleDAO.disconnect();
		
//		DBDAO oracleDAO = DBDAOFactory.create("Oracle", "scott", "tiger", "jdbc:oracle:thin:@192.168.0.10:1521/nams1", "oracle.jdbc.driver.OracleDriver");
//		java.sql.Connection conn = oracleDAO.connect();
//		oracleDAO.disconnect();
		
		DBDAO postgreSQL = DBDAOFactory.create( "PostgreSQL", "postgres", "btc7btc", "jdbc:postgresql://centos63x64:5432/bizteco", "org.postgresql.Driver");
		postgreSQL.connect();
		postgreSQL.disconnect();
	}
}
